package com.star.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "star.jwt")
@Data
public class JwtProperties {

    /**
     * 管理端生成jwt令牌相关配置
     */
    private String adminSecretKey;
    private long adminTtl;
    private String adminTokenName;

    /**
     * 商家
     */
    private String businessSecretKey;
    private long businessTtl;
    private String businessTokenName;
    /**
     * 用户端微信用户生成jwt令牌相关配置
     */
    private String userSecretKey;
    private long userTtl;               // 过期时间
    private String userTokenName;

//    private String whiteList;
//
//    public Set<String> getWhiteListAsSet() {
//        if (whiteList == null) {
//            return new HashSet<>();
//        }
//        return new HashSet<>(Arrays.stream(whiteList.split(","))
//                .map(String::trim)
//                .collect(Collectors.toList()));
//    }
}
